package efg.library.EJB;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "book", schema = "abc_library")
public class Book {  
	@Id
	@Column(name = "book_title")
	private String title = null;

	@ManyToOne
	@JoinColumn(name="book_lendTo")
	private Customer lendTo = null;

	public String getTitle()
	{
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	Customer getLendTo()
	{
		return lendTo;
	}

	void setLendTo(Customer customer)
	{
		lendTo = customer;
	}

	@Override
	public String toString()
	{
		return "book"; //"[Book: "+title+" "+lendTo.getName()+"]";
	} 
}